<?php

namespace App\Http\Middleware;

use App\Http\Util\TimeHelper;
use Closure;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route;
use App\Model\User;
use App\Model\Role;
use App\Model\AuthNode;

class WapAuthMiddleware
{
    /**
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $member = $request->session()->get('member');
        return $member ? $next($request) :  redirect('/wechat/home');
    }
}
